#include <iostream>
#include <string>
using namespace std;
//#include <utility>
class Person
{
public:
    Person(int&& age, string name) :_age(age), _name(name)
    {
        cout << "Rvalue contruct\n";
    }

    Person(int& age, string name) :_age(age), _name(name)
    {
        cout << "Lvalue contruct\n";
    }
private:
    int _age;
    string _name;
};


template<class T, class ...Args>
T createObj(Args&&...args)
{
    return T(std::forward<Args>(args)...);
}


int main() {

    int age = 10;
    string name = "zhangsna";
    Person p1 = createObj<Person>(std::move(age), name);
    Person p2 = createObj<Person>(age, name);
    Person p3 = createObj<Person>(10, name);
    return 0;
}